import request from '@/utils/request'
// 获取数据API
export function getDepartmentsAPI() {
  return request({
    url: '/company/department',
    method: 'GET'
  })
}

/**
 * @description: 获取下拉员工数据
 * @param {*}
 * @return {*}
 */
// 获取下拉员工数据
export function getEmployeeSimple() {
  return request({
    url: '/sys/user/simple'
  })
}
// 封装新增部门的api模块
export function addDepartments(data) {
  return request({
    url: '/company/department',
    method: 'post',
    data
  })
}
// 封装数据回填接口
export function getDepartDetail(id) {
  return request({
    url: `/company/department/${id}`
  })
}
// 封装修改接口
export function upDepartDetail(data) {
  return request({
    url: `/company/department/${data.id}`,
    method: 'put',
    data
  })
}

// 封装删除接口
export function delDepartments(id) {
  return request({
    url: `/company/department/${id}`,
    method: 'delete'
  })
}
